<template>
	<view>
		<view class="mp-header">
			<view class="sys-head" :style="{ height: statusBarHeight+'px;' }"></view>
			<view class="serch-box" style="height: 43px;">
				<view class="serch-wrapper">
					<view class="logo">
						<image :src="logoPath" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>
		<view :style="'height:'+marTop+'px;'"></view>
	</view>
</template>

<script>
	let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
	export default {
		name: 'campHeader',
		props: {

		},
		data() {
			return {
				statusBarHeight: statusBarHeight,
				marTop: 0,
				logoPath: '/static/img/camp_logo.png',
			};
		},
		mounted() {
			let that = this;
			setTimeout(() => {
				// 获取小程序头部高度
				let info = uni.createSelectorQuery().in(this).select(".mp-header");
				info.boundingClientRect(function(data) {
					that.marTop = data.height
				}).exec()
			}, 100)
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	/* #ifdef MP || APP-PLUS */
	.mp-header {
		z-index: 30;
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		background-color: #F7F5F0;

		.serch-wrapper {
			height: 100%;
			padding: 0 220rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			.logo {
				max-width: 280rpx;
				width: 100%;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}

	/* #endif */
</style>
